/***************************************************************
 *  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
 *  All rights reserved
 *
 *  This file is part of the GroupMe! Project. You can utilize
 *  software of the GroupMe! project under the terms of the 
 *  GNU Lesser General Public License as published by the
 *  Free Software Foundation in version 2.1.
 * 
 *  The GNU Lesser General Public License can be found at:
 *  http://www.gnu.org/licenses/lgpl.html
 *
 *  This copyright notice MUST APPEAR in all copies of the file!
 ***************************************************************/
package net.groupme.model;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;

import net.groupme.exceptions.DeleteFailedException;
import net.groupme.exceptions.InsertFailedException;
import net.groupme.exceptions.UpdateFailedException;

/**
 * This Interface defines a GroupMe! User in general.
 * 
 * created on 15.04.2007
 * 
 * @author Mischa Frank <a
 *         href="mailto:code@planetfrank.net">code@planetfrank.net</a>
 * @author Patrick Siehndel <a
 *         href="mailto:patrick.siehndel@gmx.de">patrick.siehndel@gmx.de</a>
 * @author Fabian Abel - <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * 
 * @version 0.1
 * 
 */
public interface User extends Identifiable {

	/**
	 * This method adds a group to the users grouplist.
	 * 
	 * @param group
	 *            the group to add
	 * @param role
	 *            the role of the user
	 * @throws InsertFailedException
	 */
	public void addGroup(Group group, String role) throws InsertFailedException;

	/**
	 * This method adds a tag to list of tags the user made.
	 * 
	 * @param tag
	 */
	public void addTag(Tag tag);

	/**
	 * This method adds a GroupVisualization to the list of visualizations of
	 * the user.
	 * 
	 * @param groupVisualization
	 */
	public void addVisualization(GroupVisualization groupVisualization);

	/**
	 * This method returns the password of the user.
	 * 
	 * @return the password of the user
	 */
	public boolean checkPassword(String password);

	/**
	 * This method returns the actual Visualization the user has for the given
	 * group.
	 * 
	 * @param group
	 * @return GroupVisualization for the group
	 */
	public GroupVisualization getActualVisualization(Group group);

	/**
	 * This method returns the email address of the user.
	 * 
	 * @return the email address of the user
	 */
	public String getEmail();

	/**
	 * This method returns the given name of the user.
	 * 
	 * @return the given name of the user
	 */
	public String getFirstName();

	/**
	 * This method returns the groups of the user.
	 * 
	 * @return Collection the groups of the user
	 */
	public Collection<Group> getGroups();

	/**
	 * This method returns the groups of the user where he has a given role.
	 * 
	 * @return Collection the groups of the user
	 */
	public Collection<Group> getGroups(String role);

	/**
	 * This method returns the lastname of the user.
	 * 
	 * @return the lastname of the user
	 */
	public String getLastName();
	
	/**
	 * This method returns the foaf url of the user.
	 * 
	 * @return the lastname of the user
	 */
	public String getFoaf();
	
	/**
	 * This method returns the photo of the user.
	 * 
	 * @return the photo of the user
	 */
	public String getPhoto();

	/**
	 * This method returns all the tags the user made.
	 * 
	 * @return Collection of tags the user made
	 */
	public Collection<Tag> getTags();

	/**
	 * This Method returns all tags the user made for a given Resource.
	 * 
	 * @param taggedResource
	 * @return Collection of tags the user made for a given resource
	 */
	public Collection<Tag> getTags(Resource taggedResource);

	/**
	 * This method returns the URI of the user.
	 * 
	 * @return the URI of the user (corresponds to the URI of the RDF resource)
	 * @throws URISyntaxException
	 */
	public URI getURI();

	/**
	 * This method returns the username (login name) of the user.
	 * 
	 * @return the username (login name) of the user
	 */
	public String getUserName();

	/**
	 * This method returns the GroupVisualizations the user is using.
	 * 
	 * @return GroupVisualizations the user is using
	 */
	public Collection<GroupVisualization> getVisualizations();

	/**
	 * This method returns the GroupVisualizations the User is using for a given
	 * group.
	 * 
	 * @param group
	 * @return GroupVisualization for a given group
	 */
	public Collection<GroupVisualization> getVisualizations(Group group);

	/**
	 * This method removes a group by its ID from the users grouplist.
	 * 
	 * @param group
	 *            the group to remove
	 * @throws DeleteFailedException
	 */
	public void removeGroup(Group group) throws DeleteFailedException;

	/**
	 * This method removes a tag from the list of tags the user made.
	 * 
	 * @param tag
	 */
	public void removeTag(Tag tag);

	/**
	 * This method removes a GroupVisualization from the list of visualizations
	 * of the user.
	 * 
	 * @param groupVisualization
	 */
	public void removeVisualization(GroupVisualization groupVisualization);

	/**
	 * This method sets the actual Visualization for the given group.
	 * 
	 * @param group
	 * @param groupVisualization
	 * @throws UpdateFailedException
	 */
	public void setActualVisualization(Group group,
			GroupVisualization groupVisualization) throws UpdateFailedException;

	/**
	 * This method sets the email address of the user.
	 * 
	 * @param email
	 *            the email address of the user
	 * @throws UpdateFailedException
	 */
	public void setEmail(String email) throws UpdateFailedException;

	/**
	 * This method sets the given name of the user.
	 * 
	 * @param firstname
	 *            the given name of the user
	 * @throws UpdateFailedException
	 */
	public void setFirstName(String firstname) throws UpdateFailedException;

	/**
	 * This method sets the lastname of the user.
	 * 
	 * @param lastname
	 *            the lastname of the user
	 * @throws UpdateFailedException
	 */
	public void setLastName(String lastname) throws UpdateFailedException;
	
	/**
	 * This method sets the password of the user.
	 * 
	 * @param password
	 *            the password of the user
	 * @throws UpdateFailedException
	 */
	public void setFoaf(String foaf) throws UpdateFailedException;
	
	/**
	 * This method sets the password of the user.
	 * 
	 * @param password
	 *            the password of the user
	 * @throws UpdateFailedException
	 */
	public void setPassword(String password) throws UpdateFailedException;
	
	/**
	 * This method sets the photo of the user.
	 * 
	 * @param photo the photo of the user
	 */
	public void setPhoto(String photo);


}
